<?php
$br_icon = '';
$br_text = '';
$br_slug = '';
if(isset($case) && $case=='insert'){
    $br_icon = 'fa fa-plus';
    $br_text = 'Thêm';
    $br_slug = INSERT_SLUG;
} else {
    $br_icon = 'fa fa-edit';
    $br_text = $oPostCate->getTitle();
    $br_slug = $oPostCate->getSlug();
}

?>

<div class="row">
	<div class="col-md-12">
		<h1>Danh mục tin tức <small>Quản lý các danh mục tin tức</small></h1>
		<ol class="breadcrumb">
            <li><a href="<?php echo admin_page_url(); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li><a href="<?php echo admin_post_cate_url(); ?>"><i class="fa fa-table"></i> Danh mục tin tức</a></li>
            <li><a href="<?php echo admin_post_cate_url($br_slug); ?>"><i class="<?php echo $br_icon; ?>"></i> <?php echo $br_text; ?></a></li>
        </ol>
    </div>
</div>

<div class="row">
    <h1 class="col-md-12"><?php echo $title; ?>  danh mục</h1>

    <form role="form" method="post" action="<?php echo $action; ?>" data-callback="1">
        <div class="form-group col-md-7 col-xs-12">
            <label for="input-post-cate-title">Tên danh mục</label>
            <input type="text" class="form-control auto-slug" follow-ctr='#input-post-cate-slug' id="input-post-cate-title" name="post_cate[title]" value="<?php echo $oPostCate->getTitle(); ?>" />
        </div>
        <div class="clearfix"></div>

        <div class="form-group col-md-7 col-xs-12">
            <label for="input-post-cate-template">Đường dẫn</label>
            <input type="text" class="form-control" id="input-post-cate-slug" name="post_cate[slug]" value="<?php echo $oPostCate->getSlug(); ?>"/>
        </div>
        <div class="clearfix"></div>

        <div class="form-group col-md-3 col-xs-12">
            <label for="input-post-cate-order">Thứ tự</label>
            <input type="text" class="form-control" id="input-post-cate-order" name="post_cate[order]" value="<?php echo $oPostCate->getOrder(); ?>" />
        </div>
        <div class="clearfix"></div>

        <div class="form-group col-md-12 col-xs-12">
            <?php if($title=='Cập nhật') { ?>
			<input type="hidden" name="post_cate[id]" value="<?php echo $this->encrypt->encode($oPostCate->getId()); ?>" />
            <input type="hidden" name="post_cate[case]" value="<?php echo UPDATE_FULL; ?>" />
            <?php } ?>
            <button type="button" class="btn btn-success btn-submit-update"><i class="glyphicon glyphicon-ok-sign"></i> <?php echo $title; ?></button>
            <a class="btn btn-default" href="<?php echo admin_post_cate_url(); ?>">
            	<i class="glyphicon glyphicon-share-alt"></i> Trở về
            </a>
        </div>
        <div class="clearfix"></div>
    </form>
</div>